<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>事件对象兼容性</title>
	</head>
	<body>
		<button class="btn">点击</button>
		<script type="text/javascript">
			function randStr(){
				console.log('328');
			}
			window.randStr();
			document.querySelector('.btn').onclick = function(e){
				console.log(e);
				e = e||window.event;
				console.log(e);
			}
		</script>
	</body>
</html>